/*
 * Parcel.cpp
 *
 *  Created on: Apr 26, 2012
 *      Author: gonzalo
 */

#include "Parcel.h"

Parcel::Parcel() {
}

Parcel::~Parcel() {
}


SDL_Rect Parcel::getRectangle(){
	SDL_Rect rectangle;

	rectangle.x = posX;
	rectangle.y = posY;
	rectangle.h = height;
	rectangle.w = width;

	return rectangle;
}

void Parcel::updateXY(int posX,int posY){
	this->posX = posX;
	this->posY = posY;
}

void Parcel::updateHW(int height,int width){
	this->height = height;
	this->width = width;
}

SDL_Rect Parcel::getRectangleCenter(SDL_Surface* surface){
	SDL_Rect rectangle = getRectangle();

	rectangle.x -= (surface->w) / 2;
	rectangle.y -= (surface->h) / 2;

	return rectangle;
}
